package com.runa.rccprotocol.flightControl;

import lombok.Data;
import org.springframework.http.HttpMethod;

/**
 * 2024/9/6 15:19
 * zhangYB
 */
@Data
public class ControlTask implements Comparable<ControlTask> {


    private String task;

    private String holdInfo;

    private Integer priority = 0;

    private String url;

    private HttpMethod httpMethod;

    private Object request;

    private Class responseType;

    public ControlTask(String task, String holdInfo, Integer priority, String url, HttpMethod httpMethod, Object request, Class responseType) {
        this.task = task;
        this.holdInfo = holdInfo;
        this.priority = priority;
        this.url = url;
        this.httpMethod = httpMethod;
        this.request = request;
        this.responseType = responseType;
    }

    @Override
    public int compareTo(ControlTask o) {
        return o.getPriority() - priority;
    }

}
